home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Tools / Win95 Secrets / SETUP.Z / W32SRVDB.C < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-19  |  7.5 KB  |  159 lines

  1. //==================================
  2. // W32SVSPY - Matt Pietrek 1995
  3. // FILE: W32SRVDB.C
  4. //==================================
  5. #include <windows.h>
  6. #pragma hdrstop
  7. #include "w32srvdb.h"
  8.  
  9. WIN32_SERVICE_CALL VMMServiceCalls[] = {
  10. { "_PageReserve", FALSE },      // 0x00010000
  11. { "_PageCommit", FALSE },       // 0x00010001
  12. { "_PageDecommit", FALSE },     // 0x00010002
  13. { "_PagerRegister", FALSE },        // 0x00010003
  14. { "_PagerQuery", FALSE },       // 0x00010004
  15. { "_HeapAllocate", FALSE },     // 0x00010005
  16. { "_ContextCreate", FALSE },        // 0x00010006
  17. { "_ContextDestroy", FALSE },       // 0x00010007
  18. { "_PageAttach", FALSE },       // 0x00010008
  19. { "_PageFlush", FALSE },        // 0x00010009
  20. { "_PageFree", FALSE },     // 0x0001000A
  21. { "_ContextSwitch", FALSE },        // 0x0001000B
  22. { "_HeapReAllocate", FALSE },       // 0x0001000C
  23. { "_PageModifyPermissions", FALSE },        // 0x0001000D
  24. { "_PageQuery", FALSE },        // 0x0001000E
  25. { "_GetCurrentContext", FALSE },        // 0x0001000F
  26. { "_HeapFree", FALSE },     // 0x00010010
  27. { "_RegOpenKey", FALSE },       // 0x00010011
  28. { "_RegCreateKey", FALSE },     // 0x00010012
  29. { "_RegCloseKey", FALSE },      // 0x00010013
  30. { "_RegDeleteKey", FALSE },     // 0x00010014
  31. { "_RegSetValue", FALSE },      // 0x00010015
  32. { "_RegDeleteValue", FALSE },       // 0x00010016
  33. { "_RegQueryValue", FALSE },        // 0x00010017
  34. { "_RegEnumKey", FALSE },       // 0x00010018
  35. { "_RegEnumValue", FALSE },     // 0x00010019
  36. { "_RegQueryValueEx", FALSE },      // 0x0001001A
  37. { "_RegSetValueEx", FALSE },        // 0x0001001B
  38. { "_RegFlushKey", FALSE },      // 0x0001001C
  39. { "_GetDemandPageInfo", FALSE },        // 0x0001001E
  40. { "_BlockOnID", FALSE },        // 0x0001001F
  41. { "_SignalID", FALSE },     // 0x00010020
  42. { "_RegLoadKey", FALSE },       // 0x00010021
  43. { "_RegUnLoadKey", FALSE },     // 0x00010022
  44. { "_RegSaveKey", FALSE },       // 0x00010023
  45. { "_RegRemapPreDefKey", FALSE },        // 0x00010024
  46. { "_PageChangePager", FALSE },      // 0x00010025
  47. { "_RegQueryMultipleValues", FALSE },       // 0x00010026
  48. { "_RegReplaceKey" , FALSE},            // 0x00010027
  49. };
  50.  
  51. WIN32_SERVICE_CALL VWIN32ServiceCalls[] = {
  52. { "GetVersion", FALSE },        // 0x002A0000
  53. { "Stuff VWIN32 code pointers into caller supplied buffer", FALSE },        // 0x002A0001
  54. { "GetSystemTime", FALSE },     // 0x002A0002
  55. { "Stuff code pointers from caller into VWIN32's Data area", FALSE },       // 0x002A0003
  56. { "Block on some semaphore", FALSE },       // 0x002A0004
  57. { "Calls Signal_Semaphore_No_Switch on 0x002A0004 semaphore", FALSE },      // 0x002A0005
  58. { "Calls VMM Create_Semaphore and saves it", FALSE },       // 0x002A0006
  59. { "Calls VMM Destroy _Semaphore on 0x002A0006 sem", FALSE },        // 0x002A0007
  60. { "VWIN32_CreateThread", FALSE },       // 0x002A0008
  61. { "VWIN32_Sleep", FALSE },      // 0x002A0009
  62. { "WakeThread", FALSE },        // 0x002A000A
  63. { "TerminateThread ???", FALSE },       // 0x002A000B
  64. { "Some sort of initialization", FALSE },       // 0x002A000C
  65. { "_VWIN32_QueueUserApc", FALSE },      // 0x002A000D
  66. { "VWIN32_Initialize", FALSE },     // 0x002A000E
  67. { "_VWIN32_QueueKernelApc", FALSE },        // 0x002A000F
  68. { "VINW32_Int21Dispatch", FALSE },      // 0x002A0010
  69. { "Calls IFSMgr_Win32DupHandle", FALSE },       // 0x002A0011
  70. { "VWIN32_BlockThreadSetBit", FALSE },      // 0x002A0012
  71. { "Adjust_Thread_Exec_Priority", FALSE },       // 0x002A0013
  72. { "_VWIN32_Get_Thread_Context", FALSE },        // 0x002A0014
  73. { "_VWIN32_Set_Thread_Context", FALSE },        // 0x002A0015
  74. { "Read process memory", FALSE },       // 0x002A0016
  75. { "Write process memory", FALSE },      // 0x002A0017
  76. { "calls VMCPD_Get_CR0_State", FALSE },     // 0x002A0018
  77. { "calls VMCPD_Set_CR0_State", FALSE },     // 0x002A0019
  78. { "SuspendThread", FALSE },     // 0x002A001A
  79. { "ResumeThread", FALSE },      // 0x002A001B
  80. { "??? 0x002A001C", FALSE },        // 0x002A001C
  81. { "WaitCrst", FALSE },      // 0x002A001D
  82. { "WakeCrst", FALSE },      // 0x002A001E
  83. { "Something with loading/unloading VxDs", FALSE },     // 0x002A001F
  84. { "VMCPD_Get_Version", FALSE },     // 0x00200020
  85. { "Set_Thread_Win32_Pri", FALSE },      // 0x002A0021
  86. { "calls Boost_With_Decay", FALSE },        // 0x002A0022
  87. { "calls Set_Inversion_Pri", FALSE },       // 0x002A0023
  88. { "calls Release_Inversion_Pri_ID", FALSE },        // 0x002A0024
  89. { "calls Release_Inversion_Pri", FALSE },       // 0x002A0025
  90. { "calls Attach_Thread_To_Group", FALSE },      // 0x002A0026
  91. { "calls Set_Thread_Static_Boost", FALSE },     // 0x002A0027
  92. { "calls Set_Group_Static_Boost", FALSE },      // 0x002A0028
  93. { "VWIN32_Int31Dispatch", FALSE },      // 0x002A0029
  94. { "VWIN32_Int41Dispatch", FALSE },      // 0x002A002A
  95. { "VWIN32_BlockForTermination", FALSE },        // 0x002A002B
  96. { "TerminationHandler2 (??? )", FALSE },        // 0x002A002C
  97. { "??? 0x002A002D", FALSE },        // 0x002A002D
  98. { "dwBlockSingleWnod", FALSE },     // 0x002A002E
  99. { "dwBlockMultipleWnod", FALSE },       // 0x002A002F
  100. { "VWIN32_SetEvent", FALSE },       // 0x002A0030
  101. { "Something to do with delivering APCs", FALSE },      // 0x002A0031
  102. { "??? 0x002A0032", FALSE },        // 0x002A0032
  103. { "InitUserAPCList", FALSE },       // 0x002A0033
  104. { "??? 0x002A0034", FALSE },        // 0x002A0034
  105. { "Calls VMM Signal_Semaphore_No_Switch", FALSE },      // 0x002A0035
  106. { "calls System_Control(KERNEL32_INITIALIZED)", FALSE },        // 0x002A0036
  107. { "VWIN32_CommonFaultPopup", FALSE },       // 0x002A0037
  108. { "VWIN32_ForceCrsts", FALSE },     // 0x002A0038
  109. { "??? 0x002A0039", FALSE },        // 0x002A0039
  110. { "VWIN32_FreezeAllThreads", FALSE },       // 0x002A003A
  111. { "VWIN32_UnFreezeAllThreads", FALSE },     // 0x002A003B
  112. { "calls IFSMgr_Ring0_FileIO", FALSE },     // 0x002A003C
  113. { "calls Attach_Thread_To_Group and Boost_Thread_With_VM", FALSE },     // 0x002A003D
  114. { "VWIN32_ActiveTimeBiasSet", FALSE },      // 0x002A003E
  115. { "ModifyPagePermission", FALSE },      // 0x002A003F
  116. { "used by VirtualQueryEx", FALSE },        // 0x002A0040
  117. { "ForceLeaveCrst", FALSE },        // 0x002A0041
  118. { "ForceEnterCrst", FALSE },        // 0x002A0042
  119. { "Calls VMCPD_Set_Thread_Excpt_Type", FALSE },     // 0x002A0043
  120. { "calls VTD_Get_Real_Time", FALSE },       // 0x002A0044
  121. { "calls System_Control(SET_DEVICE_FOCUS)", FALSE },        // 0x002A0045
  122. { "calls VWIN32_UnFreezeThread", FALSE },       // 0x002A0046
  123. { "calls VMM_Replace_Global_Environment", FALSE },      // 0x002A0047
  124. { "calls System_Control(KERNEL32_SHUTDOWN)", FALSE },       // 0x002A0048
  125. { "??? 0x002A0049", FALSE },        // 0x002A0049
  126. { "VW32_AddSysCrst", FALSE },       // 0x002A004A
  127. { "VW32_AddSysCrst", FALSE },       // 0x002A004B
  128. { "VW32_Cancel_Time_Out", FALSE },      // 0x002A004C
  129. { "??? 0x002A004D", FALSE },        // 0x002A004D
  130. { "setting and reflecting hotkeys", FALSE },        // 0x002A004E
  131. };
  132.  
  133. #define NUMSERVS(x) ( sizeof(x)/sizeof(WIN32_SERVICE_CALL) )
  134.  
  135. W32_SERVICE_VXD W32ServiceTable[] =
  136. {
  137. { "VMM",    0x00010000, VMMServiceCalls, NUMSERVS(VMMServiceCalls), FALSE },
  138. { "VWIN32", 0x002A0000, VWIN32ServiceCalls, NUMSERVS(VWIN32ServiceCalls), FALSE },
  139. };
  140.  
  141. unsigned CWin32ServiceVxDs = sizeof(W32ServiceTable) / sizeof(W32_SERVICE_VXD);
  142.  
  143. PWIN32_SERVICE_CALL LookupWin32ServiceCall( DWORD serviceID )
  144. {
  145.     unsigned i;
  146.     
  147.     for (i=0; i < CWin32ServiceVxDs; i++)
  148.         if ( W32ServiceTable[i].vxdID == (serviceID & 0xFFFF0000) )
  149.             break;
  150.         
  151.     if ( i >= CWin32ServiceVxDs )
  152.         return 0;
  153.     
  154.     if ( LOWORD(serviceID) >= W32ServiceTable[i].cServiceCalls )
  155.         return 0;
  156.     
  157.     return &W32ServiceTable[i].pServiceCalls[LOWORD(serviceID)];
  158. }
  159.